package learn.advance.filereader1;

import jdk.jfr.events.FileReadEvent;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

class Demo02Reader{
    public static void Test() throws IOException {
        FileReader fr=new FileReader("D:\\workplace\\新建文件夹\\test\\a.txt");
//        int len=0;
//        while((len=fr.read())!=-1){
//            System.out.println((char)len);
//        }

        char[] cs=new char[1024];
        int len=0;
        while((len=fr.read(cs))!=-1){
            System.out.println(new String(cs,0,len));
        }
    }
}



public class TestFileReader {
    public static void main(String[] args) throws IOException {
        Demo02Reader.Test();
    }
}
